#include "app_task.h"
SemaphoreHandle_t MutexSemaphore = NULL;

void lcd_Task(void *argument)
{
    while (1)
    {
       
        vTaskDelay(1000);
    }
}

void time_Task(void *argument)
{
    setup_ui(&guider_ui);
    events_init(&guider_ui);
    // lv_obj_t *lv_label1 = lv_label_create(lv_scr_act());
    // lv_label_set_text(lv_label1, "Hello World");
    // lv_obj_center(lv_label1);
    while (1)
    {

        lv_timer_handler();
        vTaskDelay(1);
    }
}

void task_main(void)
{
    lcd_init();
    lcd_display_on();
    tp_dev.init();
    lv_init();
    lv_port_disp_init();
    lv_port_indev_init();
    MutexSemaphore = xSemaphoreCreateMutex();
    xSemaphoreGive(MutexSemaphore);

    int ret = xTaskCreate(lcd_Task, "lcd_Task", 256, NULL, 5, NULL);
    ret = xTaskCreate(time_Task, "time_Task", 18 * 1024, NULL, 6, NULL);

}

void vApplicationTickHook()
{
    lv_tick_inc(1);
}
